package com.angus.modules.front.service.impl;

import com.angus.api.front.domain.FrontSendCode;
import com.angus.modules.front.repository.FrontSendCodeRepository;
import com.angus.modules.front.service.IFrontSendCodeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author liyanan
 * @date 2024/10/27 10:56 AM
 * @description
 */
@Service
public class FrontSendCodeServiceImpl implements IFrontSendCodeService {

    @Resource
    private FrontSendCodeRepository frontSendCodeRepository;

    @Override
    public boolean saveSendCode(FrontSendCode newSendCode) {
       return frontSendCodeRepository.save(newSendCode);
    }

    @Override
    public boolean updateSendCode(FrontSendCode newSendCode) {
        return frontSendCodeRepository.updateById(newSendCode);
    }

    @Override
    public FrontSendCode queryLastSendCode(String device, Integer sceneCode, String dateTime) {
        return frontSendCodeRepository.queryLastSendCode(device,sceneCode,dateTime);
    }
}
